import matplotlib.pyplot as plt
import numpy as np

x = np.linspace(0, 50, 100)

ax1 = plt.subplot(2, 2, 1)
plt.plot(x, np.sin(x), 'r')

ax2 = plt.subplot(2, 2, 2, sharey=ax1)
plt.plot(x, 2 * np.cos(x), 'g')

ax3 = plt.subplot(2, 2, 3)
plt.plot(x, np.tan(x), 'b')

ax4 = plt.subplot(2, 2, 4, sharey=ax3)
plt.plot(x, 2 * np.sin(x), 'y')

plt.show()
